@extends('layout')
@section('body')
<body class="childrenBody">
<form class="layui-form">
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="layui-input-inline">
                <input type="text" class="layui-input searchVal" placeholder="开始时间" id="test1">
            </div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input searchVal" placeholder="结束时间" id="test2">
            </div>
            <div class="layui-inline">
                <a class="layui-btn search_btn" data-type="reload">搜索</a>
            </div>
            <div class="layui-inline">
                <a class="layui-btn table_btn" data-type="reload">查看表格</a>
            </div>
            <div class="layui-inline">
                <a class="layui-btn zhexian_btn" data-type="reload">查看图表</a>
            </div>
        </form>
    </blockquote>
    <div id="main" style="width: 600px;height:400px;"></div>
    <table id="userList" lay-filter="userList"></table>

    <!--操作-->
</form>
<script src="../../layui/lay/modules/laydate.js"></script>
<script type="text/javascript" src="../../page/user/userList.js"></script>
<script type="text/javascript" src="../../js/echarts.js"></script>
<script>

</script>
<script>
    layui.use('jquery', function () {
        var $ = layui.jquery;
        $('.table_btn').click(function () {
            $('#main').addClass('layui-hide');
            $('.layui-table-view').removeClass('layui-hide');
        });

        $('.zhexian_btn').click(function () {
            $('#main').removeClass('layui-hide');
            $('.layui-table-view').addClass('layui-hide');
        });
    });
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });

        laydate.render({
            elem: '#test2' //指定元素
        });
    });
</script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: ''
        },
        tooltip: {},
        legend: {
            data:['销量']
        },
        xAxis: {
            data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
        },
        yAxis: {},
        series: [{
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
@endsection